<!DOCTYPE html>
<html lang="en">
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>WebStorm js测试</title> 
    <script>
        var num, num2, total;
        function addNum() {
            num = 12;
            num2 = 32;
            total = num + num2;
            alert(total)
        }
    </script>
</head>
<body>
<button onclick="addNum()">测试</button>
</body>
</html>